<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- <div class="container">
        <div>d1</div>
        <div id="delete">d2</div>
        <div>d3</div>
    </div> -->
    <div class="container"></div>
    <div>d1</div>
    <div id="delete">d2</div>
    <div>d3</div>
</body>
<script>
    let parent = document.querySelector('.container');
    let child  = document.querySelector('#delete');
    let element = parent.removeChild(child);  
    // console.dir(element);
    // parent.appendChild(element);
</script>
</html>